<!--
*Author：富行天下团队
 *
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/Sys_Role.js此处编写
 -->
<template>
  <div>
    <view-grid :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormFileds="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormFileds="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
  </div>
</template>

<script>
import extend from "@/extension/system/Sys_Role.js";
import ViewGrid from "@/components/basic/ViewGrid.vue";
var vueParam = {
  components: {
    ViewGrid
  },
  data () {
    return {
      table: {
        key: 'Role_Id',
        footer: "Foots",
        cnName: '商户管理',
        name: 'Role',
        url: "/Roles/",
        sortName: "Role_Id"
      },
      extend: extend,
      editFormFields: {"Dept_Id":"", "ParentId": "", "RoleName": "", "DeptName": "", "Enable": "", "Creator": "", "CreateDate": "", "Modifier": "", "ModifyDate": "","modifyID":"","createID":"" },
      editFormOptions: [[
        { "title": "商户名称", "required": true, "field": "RoleName" ,"type":"text"},
       { "title": "商户编码", "required": true, "field": "DeptName" ,"type":"text"},
       ],
       [{"title":"类型","required":true,"field":"Dept_Id","type": "select","dataKey": "role_type"},
       { "title": "父级ID",  "field":"ParentId","type": "select","dataKey": "roles" }],
       [{ "dataKey": "enable", "data": [], "title": "是否启用", "field": "Enable", "type": "switch" },],
      // { "title": "创建时间", "field": "CreateDate", "disabled": true, "type": "datetime" }],
      // [{ "title": "修改人", "field": "Modifier", "disabled": true },
      // { "title": "修改时间", "field": "ModifyDate", "disabled": true }]
      ],
      searchFormFields: { "ParentId":"" , "RoleName": "", "DeptName": "", "Enable": "", "CreateDate": "", "ModifyDate": "" ,"Dept_Id":""},
      searchFormOptions: [[{ "title": "角色名称", "field": "RoleName", "type": "like" }, 
      { "title": "商户编码", "field": "DeptName", "type": "like" },
       { "dataKey": "enable", "data": [], "title": "是否启用", "field": "Enable", "type": "select" },{"title":"类型","field":"Dept_Id","type": "select","dataKey": "role_type"},], 
       [
       { "title": "创建时间", "field": "CreateDate", "type": "datetime" }, 
       ]],
      columns: [
        // { field: 'Role_Id', title: '类型', type: 'string', width: 120, readonly: true, require: true, align: 'left', sortable: true },
      { field: 'DeptName', title: '商户编码', type: 'string', width: 200,readonly: true, require: true,align: 'left',sortable: true },
      { field: 'RoleName', title: '商户名称', type: 'string', link: true, width: 150, require: true, align: 'left' },
      
      { field: 'ParentId', title: '上级', type: 'string', bind: { key: 'roles', data: [] }, width: 70, require: true, align: 'left' },
      { field: 'Dept_Id', title: '类型',bind: { key: 'role_type', data: [] },type:'string', width: 90,  align: 'left' },
      { field: 'Enable', title: '是否启用', type: 'byte', bind: { key: 'enable', data: [] }, width: 90, align: 'left' },
      { field: 'OrderNo', title: '排序', type: 'int', width: 90, hidden: true, align: 'left' },
      { field: 'Creator', title: '创建人', type: 'string', width: 130, readonly: true, align: 'left' },
      { field: 'CreateDate', title: '创建时间', type: 'date', width: 90, readonly: true, align: 'left', sortable: true },
      { field: 'Modifier', title: '修改人', type: 'string', width: 130, readonly: true, align: 'left' },
      { field: 'ModifyDate', title: '修改时间', type: 'date', width: 90, readonly: true, align: 'left', sortable: true }],
      detail: {
        cnName: "#detailCnName",
        columns: [],
        sortName: "",
        key: ""
      }
    };
  }
};
export default vueParam;
</script>
